#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
int main()
{
	char ch[6];
	scanf("%s", &ch);
	int count = strlen(ch);
	printf("%d", count);
	putchar('\n');
	for (int i = 0; i < count; i++)
	{
		printf("%c ", ch[i]);
	}
	putchar('\n');
	for (int j = count-1; j >= 0; j--)
	{
		printf("%c ", ch[j]);
	}
	return 0;
}